package com.zx.mobile.service.proxy;

import org.apache.commons.lang3.StringUtils;

import com.zx.mobile.domain.QrInfoRequest;
import com.zx.mobile.domain.QrInfoResponse;

public class QrInfoCommonProxy {

    /**
     * 系统更新合法性校验
     *
     * @return
     */
    public static String checkQrInfo(QrInfoRequest qrInfoRequest) {
        if (StringUtils.isNotBlank(qrInfoRequest.getPlatformType())) {
            if (!("A".equals(qrInfoRequest.getPlatformType()) || "iPhone"
                    .equals(qrInfoRequest.getPlatformType()))) {
                return "平台类型不合法";
            }
        } else {
            return "输入项必填";
        }
        if (StringUtils.isBlank(qrInfoRequest.getAppUserId())) {
            return "输入项必填";
        }

        return null;
    }

    /**
     * 二维码信息
     *
     * @param qrInfoRequest
     * @return
     */
    public static QrInfoResponse getQrInfoResponse(
    		QrInfoRequest qrInfoRequest) {
    	QrInfoResponse qrInfoResponse = new QrInfoResponse();
    	qrInfoResponse.setReturnCode("0000");
        qrInfoResponse.setReturnMsg("系统信息获取成功");
        qrInfoResponse.setQrCode("130112318829182812");
        return qrInfoResponse;
    }
}
